<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="Libraries/css/ttcanbo.css" />
<script>
  $(function() {
    $( "#accordion" ).accordion();
    $(document).tooltip({
    content: function() {
        return $(this).attr('title');
    }
});
  });
  
  </script>
<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
            $conn = mysql_connect("localhost","root","") or die(mysql_error());
            mysql_select_db("llkh");
            mysql_set_charset("utf8",$conn);
            
            $query_temp ="select ND_ID,Khoa_Ten,Khoa_Email from Khoa ORDER BY Khoa_Ten ASC";
            
            $result_dskhoa = mysql_query($query_temp) or die(mysql_error());
            echo "<div id='accordion'>";
            while($row = mysql_fetch_array($result_dskhoa)){
                
                    echo  "<h3>".$row[1]."<h3>" ;
                 
                     //query danh sach can bo thuoc khoa
                    $query = "select * from canbo where (BM_MA in (select BM_MA from bomon where (ND_ID = '".$row[0]."')))";
                    
                    $result_ttcb = mysql_query($query) or die(mysql_error());;
                    echo "<div>";
                    while($rowcb_temp = mysql_fetch_array($result_ttcb)){              
                        echo "<div class='col'>";
                        echo "<div title='Mã Số: ".$rowcb_temp['ND_ID']."<br>Họ Tên: ".$rowcb_temp['CB_HO']." ".$rowcb_temp['CB_TEN']."<br>Quê Quán: ".$rowcb_temp['CB_QUEQUAN']."<br>Chức Vụ: ".$rowcb_temp['CB_CHUCVU']."<br>Chức Danh: ".$rowcb_temp['CB_CHUCDANHKH']."'>";
                        echo "<img onerror="."this.src='./Libraries/picture/no_avatar.gif';"." src='./Libraries/picture/".$rowcb_temp['ND_ID'].".jpg' height='150' width='150'></img>";
                        echo  "<p>".$rowcb_temp['CB_HO']." ".$rowcb_temp['CB_TEN']."</p>" ;
                        echo "</div>";
                        echo "</div>";
                    }
                    echo "</div>";
            } 
            echo "</div>";       
             
?>
